-
Notifications
You must be signed in to change notification settings - Fork 60
Opts for portions of the code #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| return 0; | ||
| inline Position::position_t getNext() __attribute__((always_inline)) { | ||
| return size ? entries[--size].move : 0; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer avoiding non standard C++ code.
moreover any good C++ compiler will almost certainly inline this code without having to force it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://www.cplusplus.com/articles/1AUq5Di1/
^This is standard. However, I understand if you don't want to include this for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could even further optimise this to avoid your jump statement:
size -= static_cast<int>(size > 0);
return (size > 0) * entries[size].move;
Hey @PascalPons ,
Just had a few optimizations I'd like to commit. Most of these are minor that just caught my eye.
Thanks so much